<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="父工序" prop="aboutId">
        <el-input
          v-model="queryParams.aboutId"
          placeholder="请输入父工序"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="值搜索" prop="name">
        <el-input
          v-model="queryParams.valueSearch"
          placeholder="请输入值"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--<el-form-item label="名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="注释" prop="note">
        <el-input
          v-model="queryParams.note"
          placeholder="请输入注释"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="数据状态" prop="state">
        <el-input
          v-model="queryParams.state"
          placeholder="请输入数据状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典1" prop="paramName1">
        <el-input
          v-model="queryParams.paramName1"
          placeholder="请输入参数字典1"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值1" prop="paramValue1">
        <el-input
          v-model="queryParams.paramValue1"
          placeholder="请输入参数值1"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典2" prop="paramName2">
        <el-input
          v-model="queryParams.paramName2"
          placeholder="请输入参数字典2"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值2" prop="paramValue2">
        <el-input
          v-model="queryParams.paramValue2"
          placeholder="请输入参数值2"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典3" prop="paramName3">
        <el-input
          v-model="queryParams.paramName3"
          placeholder="请输入参数字典3"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值3" prop="paramValue3">
        <el-input
          v-model="queryParams.paramValue3"
          placeholder="请输入参数值3"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典4" prop="paramName4">
        <el-input
          v-model="queryParams.paramName4"
          placeholder="请输入参数字典4"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值4" prop="paramValue4">
        <el-input
          v-model="queryParams.paramValue4"
          placeholder="请输入参数值4"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典5" prop="paramName5">
        <el-input
          v-model="queryParams.paramName5"
          placeholder="请输入参数字典5"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值5" prop="paramValue5">
        <el-input
          v-model="queryParams.paramValue5"
          placeholder="请输入参数值5"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典6" prop="paramName6">
        <el-input
          v-model="queryParams.paramName6"
          placeholder="请输入参数字典6"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值6" prop="paramValue6">
        <el-input
          v-model="queryParams.paramValue6"
          placeholder="请输入参数值6"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典7" prop="paramName7">
        <el-input
          v-model="queryParams.paramName7"
          placeholder="请输入参数字典7"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值7" prop="paramValue7">
        <el-input
          v-model="queryParams.paramValue7"
          placeholder="请输入参数值7"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典8" prop="paramName8">
        <el-input
          v-model="queryParams.paramName8"
          placeholder="请输入参数字典8"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值8" prop="paramValue8">
        <el-input
          v-model="queryParams.paramValue8"
          placeholder="请输入参数值8"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典9" prop="paramName9">
        <el-input
          v-model="queryParams.paramName9"
          placeholder="请输入参数字典9"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值9" prop="paramValue9">
        <el-input
          v-model="queryParams.paramValue9"
          placeholder="请输入参数值9"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典10" prop="paramName10">
        <el-input
          v-model="queryParams.paramName10"
          placeholder="请输入参数字典10"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值10" prop="paramValue10">
        <el-input
          v-model="queryParams.paramValue10"
          placeholder="请输入参数值10"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典11" prop="paramName11">
        <el-input
          v-model="queryParams.paramName11"
          placeholder="请输入参数字典11"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值11" prop="paramValue11">
        <el-input
          v-model="queryParams.paramValue11"
          placeholder="请输入参数值11"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典12" prop="paramName12">
        <el-input
          v-model="queryParams.paramName12"
          placeholder="请输入参数字典12"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值12" prop="paramValue12">
        <el-input
          v-model="queryParams.paramValue12"
          placeholder="请输入参数值12"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典13" prop="paramName13">
        <el-input
          v-model="queryParams.paramName13"
          placeholder="请输入参数字典13"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值13" prop="paramValue13">
        <el-input
          v-model="queryParams.paramValue13"
          placeholder="请输入参数值13"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典14" prop="paramName14">
        <el-input
          v-model="queryParams.paramName14"
          placeholder="请输入参数字典14"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值14" prop="paramValue14">
        <el-input
          v-model="queryParams.paramValue14"
          placeholder="请输入参数值14"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典15" prop="paramName15">
        <el-input
          v-model="queryParams.paramName15"
          placeholder="请输入参数字典15"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值15" prop="paramValue15">
        <el-input
          v-model="queryParams.paramValue15"
          placeholder="请输入参数值15"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典16" prop="paramName16">
        <el-input
          v-model="queryParams.paramName16"
          placeholder="请输入参数字典16"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值16" prop="paramValue16">
        <el-input
          v-model="queryParams.paramValue16"
          placeholder="请输入参数值16"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典17" prop="paramName17">
        <el-input
          v-model="queryParams.paramName17"
          placeholder="请输入参数字典17"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值17" prop="paramValue17">
        <el-input
          v-model="queryParams.paramValue17"
          placeholder="请输入参数值17"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数字典18" prop="paramName18">
        <el-input
          v-model="queryParams.paramName18"
          placeholder="请输入参数字典18"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="参数值18" prop="paramValue18">
        <el-input
          v-model="queryParams.paramValue18"
          placeholder="请输入参数值18"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['smart:processdata:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['smart:processdata:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['smart:processdata:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['smart:processdata:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="processdataList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键" align="center" prop="id" />
      <el-table-column label="父工序" align="center" prop="aboutId" />
      <el-table-column label="名称" align="center" prop="name" />
      <el-table-column label="注释" align="center" prop="note" />
      <el-table-column label="数据状态" align="center" prop="state" />
      <el-table-column label="参数字典1" align="center" prop="paramName1" />
      <el-table-column label="参数值1" align="center" prop="paramValue1" />
      <el-table-column label="参数字典2" align="center" prop="paramName2" />
      <el-table-column label="参数值2" align="center" prop="paramValue2" />
      <el-table-column label="参数字典3" align="center" prop="paramName3" />
      <el-table-column label="参数值3" align="center" prop="paramValue3" />
      <el-table-column label="参数字典4" align="center" prop="paramName4" />
      <el-table-column label="参数值4" align="center" prop="paramValue4" />
      <el-table-column label="参数字典5" align="center" prop="paramName5" />
      <el-table-column label="参数值5" align="center" prop="paramValue5" />
      <el-table-column label="参数字典6" align="center" prop="paramName6" />
      <el-table-column label="参数值6" align="center" prop="paramValue6" />
      <el-table-column label="参数字典7" align="center" prop="paramName7" />
      <el-table-column label="参数值7" align="center" prop="paramValue7" />
      <el-table-column label="参数字典8" align="center" prop="paramName8" />
      <el-table-column label="参数值8" align="center" prop="paramValue8" />
      <el-table-column label="参数字典9" align="center" prop="paramName9" />
      <el-table-column label="参数值9" align="center" prop="paramValue9" />
      <el-table-column label="参数字典10" align="center" prop="paramName10" />
      <el-table-column label="参数值10" align="center" prop="paramValue10" />
      <el-table-column label="参数字典11" align="center" prop="paramName11" />
      <el-table-column label="参数值11" align="center" prop="paramValue11" />
      <el-table-column label="参数字典12" align="center" prop="paramName12" />
      <el-table-column label="参数值12" align="center" prop="paramValue12" />
      <el-table-column label="参数字典13" align="center" prop="paramName13" />
      <el-table-column label="参数值13" align="center" prop="paramValue13" />
      <el-table-column label="参数字典14" align="center" prop="paramName14" />
      <el-table-column label="参数值14" align="center" prop="paramValue14" />
      <el-table-column label="参数字典15" align="center" prop="paramName15" />
      <el-table-column label="参数值15" align="center" prop="paramValue15" />
      <el-table-column label="参数字典16" align="center" prop="paramName16" />
      <el-table-column label="参数值16" align="center" prop="paramValue16" />
      <el-table-column label="参数字典17" align="center" prop="paramName17" />
      <el-table-column label="参数值17" align="center" prop="paramValue17" />
      <el-table-column label="参数字典18" align="center" prop="paramName18" />
      <el-table-column label="参数值18" align="center" prop="paramValue18" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['smart:processdata:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['smart:processdata:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改工序数据对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="父工序" prop="aboutId">
          <el-input v-model="form.aboutId" placeholder="请输入父工序" />
        </el-form-item>
        <el-form-item label="名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入名称" />
        </el-form-item>
        <el-form-item label="注释" prop="note">
          <el-input v-model="form.note" placeholder="请输入注释" />
        </el-form-item>
        <el-form-item label="数据状态" prop="state">
          <el-input v-model="form.state" placeholder="请输入数据状态" />
        </el-form-item>
        <el-form-item label="参数字典1" prop="paramName1">
          <el-input v-model="form.paramName1" placeholder="请输入参数字典1" />
        </el-form-item>
        <el-form-item label="参数值1" prop="paramValue1">
          <el-input v-model="form.paramValue1" placeholder="请输入参数值1" />
        </el-form-item>
        <el-form-item label="参数字典2" prop="paramName2">
          <el-input v-model="form.paramName2" placeholder="请输入参数字典2" />
        </el-form-item>
        <el-form-item label="参数值2" prop="paramValue2">
          <el-input v-model="form.paramValue2" placeholder="请输入参数值2" />
        </el-form-item>
        <el-form-item label="参数字典3" prop="paramName3">
          <el-input v-model="form.paramName3" placeholder="请输入参数字典3" />
        </el-form-item>
        <el-form-item label="参数值3" prop="paramValue3">
          <el-input v-model="form.paramValue3" placeholder="请输入参数值3" />
        </el-form-item>
        <el-form-item label="参数字典4" prop="paramName4">
          <el-input v-model="form.paramName4" placeholder="请输入参数字典4" />
        </el-form-item>
        <el-form-item label="参数值4" prop="paramValue4">
          <el-input v-model="form.paramValue4" placeholder="请输入参数值4" />
        </el-form-item>
        <el-form-item label="参数字典5" prop="paramName5">
          <el-input v-model="form.paramName5" placeholder="请输入参数字典5" />
        </el-form-item>
        <el-form-item label="参数值5" prop="paramValue5">
          <el-input v-model="form.paramValue5" placeholder="请输入参数值5" />
        </el-form-item>
        <el-form-item label="参数字典6" prop="paramName6">
          <el-input v-model="form.paramName6" placeholder="请输入参数字典6" />
        </el-form-item>
        <el-form-item label="参数值6" prop="paramValue6">
          <el-input v-model="form.paramValue6" placeholder="请输入参数值6" />
        </el-form-item>
        <el-form-item label="参数字典7" prop="paramName7">
          <el-input v-model="form.paramName7" placeholder="请输入参数字典7" />
        </el-form-item>
        <el-form-item label="参数值7" prop="paramValue7">
          <el-input v-model="form.paramValue7" placeholder="请输入参数值7" />
        </el-form-item>
        <el-form-item label="参数字典8" prop="paramName8">
          <el-input v-model="form.paramName8" placeholder="请输入参数字典8" />
        </el-form-item>
        <el-form-item label="参数值8" prop="paramValue8">
          <el-input v-model="form.paramValue8" placeholder="请输入参数值8" />
        </el-form-item>
        <el-form-item label="参数字典9" prop="paramName9">
          <el-input v-model="form.paramName9" placeholder="请输入参数字典9" />
        </el-form-item>
        <el-form-item label="参数值9" prop="paramValue9">
          <el-input v-model="form.paramValue9" placeholder="请输入参数值9" />
        </el-form-item>
        <el-form-item label="参数字典10" prop="paramName10">
          <el-input v-model="form.paramName10" placeholder="请输入参数字典10" />
        </el-form-item>
        <el-form-item label="参数值10" prop="paramValue10">
          <el-input v-model="form.paramValue10" placeholder="请输入参数值10" />
        </el-form-item>
        <el-form-item label="参数字典11" prop="paramName11">
          <el-input v-model="form.paramName11" placeholder="请输入参数字典11" />
        </el-form-item>
        <el-form-item label="参数值11" prop="paramValue11">
          <el-input v-model="form.paramValue11" placeholder="请输入参数值11" />
        </el-form-item>
        <el-form-item label="参数字典12" prop="paramName12">
          <el-input v-model="form.paramName12" placeholder="请输入参数字典12" />
        </el-form-item>
        <el-form-item label="参数值12" prop="paramValue12">
          <el-input v-model="form.paramValue12" placeholder="请输入参数值12" />
        </el-form-item>
        <el-form-item label="参数字典13" prop="paramName13">
          <el-input v-model="form.paramName13" placeholder="请输入参数字典13" />
        </el-form-item>
        <el-form-item label="参数值13" prop="paramValue13">
          <el-input v-model="form.paramValue13" placeholder="请输入参数值13" />
        </el-form-item>
        <el-form-item label="参数字典14" prop="paramName14">
          <el-input v-model="form.paramName14" placeholder="请输入参数字典14" />
        </el-form-item>
        <el-form-item label="参数值14" prop="paramValue14">
          <el-input v-model="form.paramValue14" placeholder="请输入参数值14" />
        </el-form-item>
        <el-form-item label="参数字典15" prop="paramName15">
          <el-input v-model="form.paramName15" placeholder="请输入参数字典15" />
        </el-form-item>
        <el-form-item label="参数值15" prop="paramValue15">
          <el-input v-model="form.paramValue15" placeholder="请输入参数值15" />
        </el-form-item>
        <el-form-item label="参数字典16" prop="paramName16">
          <el-input v-model="form.paramName16" placeholder="请输入参数字典16" />
        </el-form-item>
        <el-form-item label="参数值16" prop="paramValue16">
          <el-input v-model="form.paramValue16" placeholder="请输入参数值16" />
        </el-form-item>
        <el-form-item label="参数字典17" prop="paramName17">
          <el-input v-model="form.paramName17" placeholder="请输入参数字典17" />
        </el-form-item>
        <el-form-item label="参数值17" prop="paramValue17">
          <el-input v-model="form.paramValue17" placeholder="请输入参数值17" />
        </el-form-item>
        <el-form-item label="参数字典18" prop="paramName18">
          <el-input v-model="form.paramName18" placeholder="请输入参数字典18" />
        </el-form-item>
        <el-form-item label="参数值18" prop="paramValue18">
          <el-input v-model="form.paramValue18" placeholder="请输入参数值18" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listProcessdata, getProcessdata, delProcessdata, addProcessdata, updateProcessdata } from "@/api/smart/processdata";

export default {
  name: "Processdata",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 工序数据表格数据
      processdataList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        aboutId: null,
        name: null,
        note: null,
        state: null,
        valueSearch: null,
        paramName1: null,
        paramValue1: null,
        paramName2: null,
        paramValue2: null,
        paramName3: null,
        paramValue3: null,
        paramName4: null,
        paramValue4: null,
        paramName5: null,
        paramValue5: null,
        paramName6: null,
        paramValue6: null,
        paramName7: null,
        paramValue7: null,
        paramName8: null,
        paramValue8: null,
        paramName9: null,
        paramValue9: null,
        paramName10: null,
        paramValue10: null,
        paramName11: null,
        paramValue11: null,
        paramName12: null,
        paramValue12: null,
        paramName13: null,
        paramValue13: null,
        paramName14: null,
        paramValue14: null,
        paramName15: null,
        paramValue15: null,
        paramName16: null,
        paramValue16: null,
        paramName17: null,
        paramValue17: null,
        paramName18: null,
        paramValue18: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询工序数据列表 */
    getList() {
      this.loading = true;
      listProcessdata(this.queryParams).then(response => {
        this.processdataList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        aboutId: null,
        createTime: null,
        name: null,
        note: null,
        state: null,
        paramName1: null,
        paramValue1: null,
        paramName2: null,
        paramValue2: null,
        paramName3: null,
        paramValue3: null,
        paramName4: null,
        paramValue4: null,
        paramName5: null,
        paramValue5: null,
        paramName6: null,
        paramValue6: null,
        paramName7: null,
        paramValue7: null,
        paramName8: null,
        paramValue8: null,
        paramName9: null,
        paramValue9: null,
        paramName10: null,
        paramValue10: null,
        paramName11: null,
        paramValue11: null,
        paramName12: null,
        paramValue12: null,
        paramName13: null,
        paramValue13: null,
        paramName14: null,
        paramValue14: null,
        paramName15: null,
        paramValue15: null,
        paramName16: null,
        paramValue16: null,
        paramName17: null,
        paramValue17: null,
        paramName18: null,
        paramValue18: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加工序数据";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getProcessdata(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改工序数据";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateProcessdata(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProcessdata(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除工序数据编号为"' + ids + '"的数据项？').then(function() {
        return delProcessdata(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('smart/processdata/export', {
        ...this.queryParams
      }, `processdata_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
